<?xml version="1.0" encoding="utf-8"?>
 <grammar xmlns="http://relaxng.org/ns/structure/1.0" xmlns:svg="http://www.w3.org/2000/svg">
   <start>
     <element name="library">
       <oneOrMore>
         <ref name="book-element"/>
       </oneOrMore>
     </element>
   </start>
   <define name="author-element">
     <element name="author">
       <svg:svg>
         <svg:title>A typical author</svg:title>
         <svg:ellipse style="stroke:#000000; fill:#e3e000; stroke-width:2pt;" id="head" cx="280" cy="250" rx="110" ry="130"/>
         <svg:ellipse style="stroke:none; fill:#7f7f7f; " id="leftEye" cx="240" cy="225" rx="18" ry="18"/>
         <svg:ellipse style="stroke:none; fill:#7f7f7f; " id="rightEye" cx="320" cy="225" rx="18" ry="18"/>
         <svg:path style="fill:none;stroke:#7F7F7F; stroke-width:5pt;" id="mouth" d="M 222 280 A 58 48 0 0 0 338 280"/>
       </svg:svg>
       <attribute name="id"/>
       <ref name="name-element"/>
       <ref name="born-element"/>
       <optional>
         <ref name="dead-element"/>
       </optional>
     </element>
   </define>
   <define name="book-start">
     <attribute name="id"/>
     <ref name="isbn-element"/>
     <ref name="title-element"/>
     <zeroOrMore>
       <ref name="author-element"/>
     </zeroOrMore>
   </define>
   <define name="book-end">
     <zeroOrMore>
       <ref name="author-element"/>
     </zeroOrMore>
     <zeroOrMore>
       <ref name="character-element"/>
     </zeroOrMore>
     <attribute name="available"/>
   </define>
   <define name="book-element">
     <element name="book">
       <ref name="book-start"/>
       <ref name="book-end"/>
     </element>
   </define>
   <define name="born-element">
     <element name="born">
       <text/>
     </element>
   </define>
   <define name="character-element">
     <element name="character">
       <attribute name="id"/>
       <ref name="name-element"/>
       <ref name="born-element"/>
       <ref name="qualification-element"/>
     </element>
   </define>
   <define name="dead-element">
     <element name="dead">
       <text/>
     </element>
   </define>
   <define name="isbn-element">
     <element name="isbn">
       <text/>
     </element>
   </define>
   <define name="name-element">
     <element name="name">
       <text/>
     </element>
   </define>
   <define name="qualification-element">
     <element name="qualification">
       <text/>
     </element>
   </define>
   <define name="title-element">
     <element name="title">
       <attribute name="xml:lang"/>
       <text/>
     </element>
   </define>
 </grammar>
